# A tibble: 5 × 20
country year site origin length weight age.sea age.sm sex lat lon
<chr> <dbl> <chr> <chr> <dbl> <dbl> <dbl> <dbl> <chr> <dbl> <dbl>
1 FIN 2014 Tornionjo… wild 1100 16500 8 4 f 65.9 24.1
2 FIN 2008 Tornionjo… wild 1190 16600 8 3 f 65.9 24.1
3 SWE 2004 Östersjön… wild 1070 960000 7 4 <NA> 58.5 19.8
4 FIN 2012 Tornionjo… wild 1020 9640 6 5 f 65.9 24.1
5 FIN 2009 Tornionjo… wild 1230 16400 9 3 f 65.9 24.1
# ℹ 9 more variables: asses.unit <dbl>, stock.origin <chr>, stock.unit <chr>,
# region <chr>, river <chr>, region.gen <chr>, spat.unit <chr>,
# age.type <chr>, age.tot <dbl>
Hists of age and length
Show code
# If dropping all inds where both sea and sm age is NA sallaa2 %>%ggplot() +geom_density(aes(x = age.tot), fill ="deeppink", alpha =0.5) +xlim(0, 13) +sallaa2 %>%ggplot() +geom_density(aes(x = length), fill ="deeppink", alpha =0.5)
select: dropped 18 variables (country, year, site, origin, weight, …)
Defining model
Building model
Setting data and initial values
Running calculate on model
[Note] Any error reports that follow may simply reflect missing values in model variables.
Error in chol.default(model$tau_klt[1:3, 1:3]) :
the leading minor of order 1 is not positive
Checking model sizes and dimensions
[Note] This model is not fully initialized. This is not an error.
To see which variables are not initialized, use model$initializeInfo().
For more information on model initialization, see help(modelInitialization).
Show code
# compile modelvbgf1a.c <-compileNimble(model_3a)
Compiling
[Note] This may take a minute.
[Note] Use 'showCompilerOutput = TRUE' to see C++ compilation details.
select: dropped 16 variables (country, year, site, origin, weight, …)
mutate: converted 'sex' from character to integer (0 new NA)
converted 'spat.unit' from character to integer (0 new NA)
drop_na: removed 13,544 rows (34%), 26,456 rows remaining
select: dropped one variable (spat.unit)
Defining model
Building model
Setting data and initial values
Running calculate on model
[Note] Any error reports that follow may simply reflect missing values in model variables.
Error in chol.default(model$tau_klt[1:3, 1:3]) :
the leading minor of order 1 is not positive
Checking model sizes and dimensions
[Note] This model is not fully initialized. This is not an error.
To see which variables are not initialized, use model$initializeInfo().
For more information on model initialization, see help(modelInitialization).
Show code
# compile modelvbgf1b.c <-compileNimble(model_3b)
Compiling
[Note] This may take a minute.
[Note] Use 'showCompilerOutput = TRUE' to see C++ compilation details.
Show code
vbgf1b.c$beta1 # if not using inits in nimbleModel, these calculated varaibles wont show up
select: dropped 16 variables (country, year, site, origin, weight, …)
mutate: converted 'sex' from character to integer (0 new NA)
converted 'spat.unit' from character to integer (0 new NA)
drop_na: removed 13,544 rows (34%), 26,456 rows remaining
select: dropped one variable (spat.unit)
Defining model
Building model
Setting data and initial values
Running calculate on model
[Note] Any error reports that follow may simply reflect missing values in model variables.
Error in chol.default(model$tau_klt[1:3, 1:3]) :
the leading minor of order 1 is not positive
Checking model sizes and dimensions
[Note] This model is not fully initialized. This is not an error.
To see which variables are not initialized, use model$initializeInfo().
For more information on model initialization, see help(modelInitialization).
Show code
# compile modelvbgf1c.c <-compileNimble(model_3d)
Compiling
[Note] This may take a minute.
[Note] Use 'showCompilerOutput = TRUE' to see C++ compilation details.
select: dropped 16 variables (country, year, site, origin, weight, …)
mutate: converted 'sex' from character to integer (0 new NA)
converted 'spat.unit' from character to integer (0 new NA)
drop_na: removed 13,544 rows (34%), 26,456 rows remaining
select: dropped one variable (spat.unit)
Defining model
Building model
Setting data and initial values
Running calculate on model
[Note] Any error reports that follow may simply reflect missing values in model variables.
Error in chol.default(model$tau_klt[1:3, 1:3]) :
the leading minor of order 1 is not positive
Checking model sizes and dimensions
[Note] This model is not fully initialized. This is not an error.
To see which variables are not initialized, use model$initializeInfo().
For more information on model initialization, see help(modelInitialization).
Show code
# compile modelvbgf1d.c <-compileNimble(model_3d)
Compiling
[Note] This may take a minute.
[Note] Use 'showCompilerOutput = TRUE' to see C++ compilation details.
$c
nimbleList object of type waicNimbleList
Field "WAIC":
[1] 309008.4
Field "lppd":
[1] -154463.6
Field "pWAIC":
[1] 40.60854
$d
nimbleList object of type waicNimbleList
Field "WAIC":
[1] 308291.9
Field "lppd":
[1] -154094.3
Field "pWAIC":
[1] 51.64428